
*********************************************************************************************************************
* Religious diversity and Protestant and Catholic respondents' church attendance and divorce in FORSA data, Table A31 
* Charnysh and Schaub, Migration and Social Change: Evidence from post-WWII Displacement in Germany, JOP
*********************************************************************************************************************


use "individual_data/forsa_1996_2010.dta", clear

global controls age female foreign relfrac1939 srefugees1950 ShareAgric1939 sfem1939 lnDistEastBorder popdens1939 ShareDestroyed LnPop1939 i.land lon lat i.year // no distance to station, Länder FEs instead of Kreise

global controls_noref age female foreign relfrac1939 ShareAgric1939 sfem1939 lnDistEastBorder popdens1939 ShareDestroyed LnPop1939 i.land lon lat i.year 



** Church attendance

* All catholics
eststo churchcat: reg churchattend DeltaFrac $controls if religion==2 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): churchcat 
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': churchcat

* Previously homogenous catholic regions
eststo churchcat80: reg churchattend c.DeltaFrac $controls if religion==2 & scatholics1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): churchcat80 
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': churchcat80

* All protestants
eststo churchprot: reg churchattend DeltaFrac $controls if religion==1 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): churchprot
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': churchprot

* Previously homogenous protestant regions
eststo churchprot80: reg churchattend DeltaFrac $controls if religion==1 & sprotestants1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): churchprot80 
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': churchprot80



** Divorce

* All catholics
eststo divcat: reg divorced DeltaFrac $controls if religion==2 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): divcat 
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': divcat

* Previously homogenous catholic regions
eststo divcat80: reg divorced DeltaFrac $controls if religion==2 & scatholics1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): divcat80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': divcat80

* All protestants
eststo divprot: reg divorced DeltaFrac $controls if religion==1 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): divprot 
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': divprot

* Previously homogenous protestant regions
eststo divprot80: reg divorced DeltaFrac $controls if religion==1 & sprotestants1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): divprot80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': divprot80

		
*** Without controlling for share expellees


** Church attendance

* All catholics
eststo ptchurchcat: reg churchattend DeltaFrac $controls_noref if religion==2 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptchurchcat
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptchurchcat

* Previously homogenous catholic regions
eststo ptchurchcat80: reg churchattend c.DeltaFrac $controls_noref if religion==2 & scatholics1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptchurchcat80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptchurchcat80

* All protestants
eststo ptchurchprot: reg churchattend DeltaFrac $controls_noref if religion==1 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust) : ptchurchprot
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptchurchprot

* Previously homogenous protestant regions
eststo ptchurchprot80: reg churchattend DeltaFrac $controls_noref if religion==1 & sprotestants1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptchurchprot80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptchurchprot80


** Divorce

* All catholics
eststo ptdivcat: reg divorced DeltaFrac $controls_noref if religion==2 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptdivcat
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptdivcat

* Previously homogenous catholic regions
eststo ptdivcat80: reg divorced DeltaFrac $controls_noref if religion==2 & scatholics1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptdivcat80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptdivcat80

* All protestants
eststo ptdivprot: reg divorced DeltaFrac $controls_noref if religion==1 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptdivprot
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptdivprot

* Previously homogenous protestant regions
eststo ptdivprot80: reg divorced DeltaFrac $controls_noref if religion==1 & sprotestants1939>.8 [pweight= weight1], cluster(KREIS87)
estadd local year "\checkmark"
estadd local land "\checkmark"
estadd scalar ncounty =  e(N_clust): ptdivprot80
margins, at(DeltaFrac==0) post coefl
local bb = _b[_cons]
estadd scalar base = `bb': ptdivprot80


*** Table standard

esttab churchcat churchcat80 churchprot churchprot80 divcat divcat80 divprot divprot80, varwidth(35) label keep(DeltaFrac relfrac1939 srefugees1950) nomtitle ///
			 r2 b(%8.2f) se(%8.2f) sfmt(%9.2gc) se compress nogaps stats(N r2 year land base, fmt(%9.0gc %9.2f) labels("Num. obs." "R2" "Year FEs" "Coord. \& state FEs"  "Baseline")) star(* 0.10 ** 0.05 *** 0.01) booktabs
		

		
*** Table no share expellees

esttab ptchurchcat ptchurchcat80 ptchurchprot ptchurchprot80 ptdivcat ptdivcat80 ptdivprot ptdivprot80, varwidth(35) label keep(DeltaFrac relfrac1939) nomtitle ///
			 r2 b(%8.2f) se(%8.2f) sfmt(%9.2gc) se compress nogaps stats(N r2 year land base, fmt(%9.0gc %9.2f) labels("Num. obs." "R2" "Year FEs" "Coord. \& state FEs" "Baseline")) star(* 0.10 ** 0.05 *** 0.01) booktabs
		

